#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import unittest
import os

__project_ = 'bzjsons'
__file_name__ = 'run_all_cases'
__author__ = 'bright.zhang'
__time__ = '2020/6/23 10:51'


case_path = os.path.dirname(os.path.realpath(__file__))
report_path = os.path.join(case_path, 'report')


def get_all_test_cases():
    # 绕开sqlalchemy_objects_test的自动执行，这个对数据库有依赖，须手动执行
    return unittest.defaultTestLoader.discover(case_path, pattern="*_test.py", top_level_dir=None)


# 此处执行当前项目所有单元测试
# 用以代替手动按模块执行的方式
if __name__ == '__main__':
    runner = unittest.TextTestRunner()
    runner.run(get_all_test_cases())
